﻿/**
 * 
 * @file TreeWidgetModel.h
 * @brief 模型页面声明
 * @author LiBaojun (libaojunqd@foxmail.com)
 * @date 2024-10-12
 * 
 */
#ifndef _TREE_WIDGET_MODEL_H___
#define _TREE_WIDGET_MODEL_H___

#include "ControlPanel.h"
#include "FITK_Interface/FITKInterfaceGeometry/FITKGeoEnum.h"

namespace Interface {
    class FITKAbsVirtualTopo;
}

namespace GUI
{
    /**
     * @brief 分组页面
     * @author LiBaojun (libaojunqd@foxmail.com)
     * @date 2024-10-12
     */
    class GUIWIDGETAPI TreeWidgetModel : public TreeWidgetPage
    {
    public:
        /**
         * @brief Construct a new Tree Widget Model object
         * @param[i]  parent         父对象
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-12
         */
        explicit TreeWidgetModel(QWidget* parent = nullptr);
        /**
         * @brief Destroy the Tree Widget Model object
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-12
         */
        virtual ~TreeWidgetModel() = default;
        /**
         * @brief 获取类型
         * @return TreeWidgetType 
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-10-12
         */
        TreeWidgetType getTreeWidgetType() override;
        /**
         * @brief    更新模型树菜单状态[不会更新渲染，只根据当前数据显示状态刷新菜单状态]
         * @author   BaGuijun (baguijun@163.com)
         * @date     2025-01-15
         */
        void updateModelTreeItemState();
    protected:


    private:
        /**
         * @brief    初始化树形菜单
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-10-22
         */
        void initTree();
        /**
         * @brief 树形菜单节点点击事件，子类重写实现
         * @param[i]  item           点击对象
         * @param[i]  column         列数
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-10-22
         */
        virtual void on_itemClicked(QTreeWidgetItem *item, int column) override;
        /**
         * @brief 树形菜单节点双击事件，子类重写实现
         * @param[i]  item           点击对象
         * @param[i]  column         列数
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-10-22
         */
        virtual void on_itemDoubleClicked(QTreeWidgetItem *item, int column) override;
        /**
         * @brief    树形菜单节点状态改变事件，子类重写实现
         * @param[i] item 点击对象
         * @param[i] state 改变之后的状态
         * @param[i] column 列数
         * @return   void
         * @author   liuzhonghua (liuzhonghuaszch@163.com)
         * @date     2024-10-22
         */
        virtual void on_itemStateChanged(QTreeWidgetItem *item, bool state, int column) override;
        /**
         * @brief    获取几何虚拓扑数据
         * @param[i] type                                       几何数据类型
         * @return   QList<Interface::FITKAbsVirtualTopo*>      虚拓扑数据链表
         * @author   BaGuijun (baguijun@163.com)
         * @date     2025-02-19
         */
        QList<Interface::FITKAbsVirtualTopo*> getAllGeometryVirTopos(Interface::FITKGeoEnum::VTopoShapeType type);
    };
}


#endif
